package com.woniuxy.micropromotionserver.promotionmag.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface PromoAndMemberMapper {
    /**
     * 1这是一个对中间表（促销单id和会员类型的中间表）   加数据的
     * pid 促销单id
     * mid,会员类型id
     */
    @Insert("insert into t_promo_vip_info " +
            "(fk_promo_id,fk_viptype_id)" +
            " values(#{pid},#{mid})" )
    int savePidAndMid(@Param("pid") Long pid, @Param("mid")Long mid);

    /**
     * 2 删除多条该促销单和会员类型的中间关系  根据促销单id
     * @return
     */
    @Delete("delete from t_promo_vip_info where fk_promo_id = #{pid}")
    int delPidAndMid(Long pid);

}
